1. Field of the Invention
This invention relates in general to computer/user interfaces, and in particular to a computer program which assists the user in understanding computer source code.
2. Description of Related Art
Computer programmers spend a great deal of time studying the source code of existing programs. They must do this in order to correct problems, make improvements, prepare estimates, and answer questions. In addition, while writing a program, the programmer spends a great deal of time studying the code that has already been written.
In most programming languages, the programmer is free to invent names for data and procedures, as long as these names do not conflict with reserved words whose meaning is fixed by the language. Usually a name is defined in one place and may be referenced in any number of places.
Computer programs are usually difficult to understand. One of the reasons for this is that, in order to understand the program, the programmer must frequently look up the definition of, or references to, a name. Often this means searching through thousands of lines of code.
Currently, two devices exist which help the user look up information: cross-references and text editors.
A cross-reference is a printed, alphabetized list of all the names that the programmer has defined. Next to the name is printed the line numbers where the name is defined and referenced. In a variation on the cross-reference idea, some products embed cross-reference information within a listing of the source program.
While helpful, cross-references require a lot of paper shuffling by the user. They also quickly become out of date as the program is modified.
Today, most programmers use text editor software to develop and maintain source code. Most text editors have a search function which helps the user look up names. By typing in a name, the user can find all the places in the program where the name occurs.
A text editor has several drawbacks when used to study programs. It requires a fair amount of typing. As the program gets larger, the editor takes longer to find a name. Often, it does not find what the user is looking for. For example, it may find a longer name that contains the characters that the user typed, or it may find a reference when the user was looking for a definition. In some programming languages, the same name can be re-used in many definitions; the context of a reference determines which definition it refers to. Text editors fail to distinguish between the various definitions of the same name. When the editor finally locates the correct information, the user is faced with the task of finding his way back to where he started. This is very difficult when one search triggers another, which triggers another, etc.
Whatever the merits of cross-references and text editors, they do not achieve the benefits of the present invention.